package com.miao.service.impl;

import com.miao.dao.CategoryDao;
import com.miao.entity.Category;
import com.miao.service.CategoryService;
import com.miao.util.BeanCopyUtil;
import com.miao.vo.CategoryVo;
import com.miao.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.xml.transform.Result;
import java.util.List;

@Service
public class CategoryImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    @Override
    public List<CategoryVo> getAlls(String categoryName) {
        List<Category> categories = categoryDao.queryAll(categoryName);

        return BeanCopyUtil.copyListProperties(categories,CategoryVo.class);
    }
}
